<template>
  <div class="wty-nav">
    <el-menu
      class="el-menu-vertical-demo"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b"
      @open="_open"
      @close="_close"
      :unique-opened="isOpen"
      default-active="1-1"
    >
      <el-submenu index="1">
        <template slot="title">
          <i class="el-icon-s-unfold"></i>
          <span>信息管理</span>
        </template>
        <el-menu-item index="1-1" @click="_link('/')">用户管理</el-menu-item>
        <el-menu-item index="1-2" @click="_link('/goods')"
          >商品管理</el-menu-item
        >
      </el-submenu>
      <el-submenu index="2">
        <template slot="title">
          <i class="el-icon-s-unfold"></i>
          <span>导航二</span>
        </template>
        <el-menu-item index="2-1">选项1</el-menu-item>
        <el-menu-item index="2-2">选项2</el-menu-item>
      </el-submenu>
      <el-submenu index="3">
        <!-- el-icon-setting -->
        <template slot="title">
          <i class="el-icon-setting"></i>
          <span>导航三</span>
        </template>
        <el-menu-item index="3-1">选项1</el-menu-item>
        <el-menu-item index="3-2">选项2</el-menu-item>
        <el-menu-item index="3-3">选项3</el-menu-item>
        <el-menu-item index="3-4">选项4</el-menu-item>
        <el-menu-item index="3-5">选项5</el-menu-item>
        <el-menu-item index="3-6">选项6</el-menu-item>
        <el-menu-item index="3-7">选项7</el-menu-item>
        <el-menu-item index="3-8">选项8</el-menu-item>
      </el-submenu>
    </el-menu>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isOpen: true
    };
  },
  methods: {
    _open() {},
    _close() {},
    _link(url) {
      this.$router.push({
        path: url
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.wty-nav {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding-right: 10px;
}
</style>
